<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    876. Hand of Straights
   </h1>
   <p>
    Alice has a
    <code>
     hand
    </code>
    of cards, given as an array of integers.
   </p>
   <p>
    Now she wants to rearrange the cards into groups so that each group is size
    <code>
     W
    </code>
    , and consists of
    <code>
     W
    </code>
    consecutive cards.
   </p>
   <p>
    Return
    <code>
     true
    </code>
    if and only if she can.
   </p>
   <p>
    &nbsp;
   </p>
   <ol>
   </ol>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input: </strong>hand = [1,2,3,6,2,3,4,7,8], W = 3
<strong>Output: </strong>true
<strong>Explanation:</strong> Alice's <code>hand</code> can be rearranged as <code>[1,2,3],[2,3,4],[6,7,8]</code>.</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input: </strong>hand = [1,2,3,4,5], W = 4
<strong>Output: </strong>false
<strong>Explanation:</strong> Alice's <code>hand</code> can't be rearranged into groups of <code>4</code>.</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <ol>
    <li>
     <code>
      1 &lt;= hand.length &lt;= 10000
     </code>
    </li>
    <li>
     <code>
      0 &lt;= hand[i]&nbsp;&lt;= 10^9
     </code>
    </li>
    <li>
     <code>
      1 &lt;= W &lt;= hand.length
     </code>
    </li>
   </ol>
  </div>
  <div>
   <h1 class="question_title">
    876. 一手顺子
   </h1>
   <p>
    爱丽丝有一手（
    <code>
     hand
    </code>
    ）由整数数组给定的牌。&nbsp;
   </p>
   <p>
    现在她想把牌重新排列成组，使得每个组的大小都是
    <code>
     W
    </code>
    ，且由
    <code>
     W
    </code>
    张连续的牌组成。
   </p>
   <p>
    如果她可以完成分组就返回
    <code>
     true
    </code>
    ，否则返回
    <code>
     false
    </code>
    。
   </p>
   <p>
    &nbsp;
   </p>
   <ol>
   </ol>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>hand = [1,2,3,6,2,3,4,7,8], W = 3
<strong>输出：</strong>true
<strong>解释：</strong>爱丽丝的手牌可以被重新排列为 <code>[1,2,3]，[2,3,4]，[6,7,8]</code>。</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入：</strong>hand = [1,2,3,4,5], W = 4
<strong>输出：</strong>false
<strong>解释：</strong>爱丽丝的手牌无法被重新排列成几个大小为 4 的组。</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ol>
    <li>
     <code>
      1 &lt;= hand.length &lt;= 10000
     </code>
    </li>
    <li>
     <code>
      0 &lt;= hand[i]&nbsp;&lt;= 10^9
     </code>
    </li>
    <li>
     <code>
      1 &lt;= W &lt;= hand.length
     </code>
    </li>
   </ol>
  </div>
 </body>
</html>